package com.kingbi.util.dao;

import java.io.Serializable;
import java.sql.SQLException;
import java.util.List;

/**
 * 
 * @author mouzb
 * 
 * @param <T>
 * @param <ID>
 */
public interface GenericDao<T, ID extends Serializable>
{
    T findById(ID id);

    List<T> findAll();

    List<T> findByExample(T exampleInstance, String[] excludeProperty);

    T save(T entity);

    void delete(T entity);
    
    
    T add_update(T entity);

    Long getCountByHQL(final String queryStr, final Object[] params);

    List<T> findByHQL(final String queryStr, final Object[] params, final int start, final int max);

    List<Object> findBySQL(final String qeurySql, final Object[] params) throws SQLException;

    public List<Object> findBySQL(final String qeurySql, final Object[] params, final int start,
            final int max) throws SQLException;

    boolean delteByHQL(final String queryStr, final Object[] params);
    public int exeSql(final String sql) throws Exception;
    public int deleteBySQL(final String sql) throws SQLException;
    public T add(T entity);
    public T update(T entity);
    public void exeProcedure(String procString,List<Object> params) throws Exception;
    public List<Object> callProcedure(String procString,Object[] params) throws Exception;
}